<%@ page language="java" contentType="text/html; charset=utf-8 " import="domain.User,domain.Account,java.util.*,service.account.*,service.balance.*"
pageEncoding="utf-8"%>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta charset="utf-8" />
		<meta charset="utf-8">
	<title>用户中心</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../css/public.css">
	<link rel="stylesheet" href="use.css" media="all" />
</head>
<body>
    <%
    User user = new User();
    user=(User)session.getAttribute("userloginflag");
    AccountService accountService = new AccountServiceImpl();
    BalanceService balanceService = new BalanceServiceImpl();
    List<Account> list = accountService.getAccountList(user.getUsername());

     %>
	<blockquote class="layui-elem-quote quoteBox mod_default_box">

			<div class="layui-inline">
			    余额: <%=balanceService.getBalance(user.getUsername()) %><br />
				支出统计:<span style="color:red"><%=accountService.countOut(user.getUsername()) %></span> <br />
				收入统计:<span style="color:green"><%=accountService.countCome(user.getUsername()) %></span>
			</div>
			<div class="layui-inline">
			</div>
            <div class="layui-inline">
                <br />
            	本月支出统计:<span style="color:red"><%=accountService.nowCountOut(user.getUsername()) %></span> <br />
            	本月收入统计:<span style="color:green"><%=accountService.nowCountCome(user.getUsername()) %></span>
            </div>
            <div class="layui-inline">
            </div>
             <div class="layui-inline">
                 <br />
                 上月支出统计:<span style="color:red"><%=accountService.lastCountOut(user.getUsername()) %></span> <br />
                 上月收入统计:<span style="color:green"><%=accountService.lastCountCome(user.getUsername()) %></span>
             </div>
	</blockquote>
	<table id="userList" lay-filter="userList" lay-skin="line"></table>

<div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1" style=" ">
	<div class="layui-table-box">
		<div class="layui-table-header">
			<table cellspacing="0" cellpadding="0" border="0" class="layui-table" style="width: 100%;">
				<thead>
					<tr>
						
						<th data-field="userId" style="width: 20%;">
							<div class="layui-table-cell laytable-cell-1-userName" align="center">
								<span>时间</span>
							</div>
						</th>
						<th data-field="userName" style="width: 40%;">
							<div class="layui-table-cell laytable-cell-1-userEmail" align="center">
								<span>事由</span>
							</div>
						</th>
						<th data-field="Name" style="width: 20%;">
							<div class="layui-table-cell laytable-cell-1-userSex" align="center">
								<span>支出</span>
							</div>
						</th>
						<th data-field="userEndTime" style="width: 20%;">
							<div class="layui-table-cell laytable-cell-1-userStatus" align="center">
								<span>收入</span>
							</div>
						</th>
						

					</tr>
				</thead>
			</table>
		</div>
		<div class="layui-table-body layui-table-main">
			<table cellspacing="0" cellpadding="0" border="0" class="layui-table" style="width: 100%;">
				<tbody>
				<% for(int i =0; i<list.size();i++){ %>
					<tr data-index="0" class="">
						<td data-field="userId" align="center" style="width: 20%;">
							<div class="layui-table-cell laytable-cell-1-userName"><%=list.get(i).getTime() %></div>
						</td>
						<td data-field="userName" style="width: 40%;" align="center" data-content="1234ws.com">
							<div class="layui-table-cell laytable-cell-1-userEmail">
								<%=list.get(i).getInfo() %>
							</div>
						</td>
						<td data-field="Name" align="center" style="width: 20%;">
							<div class="layui-table-cell laytable-cell-1-userSex" style="color:red"><%=list.get(i).getOut() %></div>
						</td>
						
						<td data-field="userEndTime" align="center" style="width: 20%;">
							<div class="layui-table-cell laytable-cell-1-userEndTime" style="color:green"><%=list.get(i).getCome() %></div>
						</td>

					</tr>
					<% } %>
				</tbody>
			</table>
		</div>
		
		
</div>

</body>
</html>